﻿#ifndef SPECTRUMPLAYBACKWEBSOCKETCLIENT_H
#define SPECTRUMPLAYBACKWEBSOCKETCLIENT_H

#include "spectrumplayback.h"

#include <QMutex>
#include <QObject>
#include <QWebSocket>

class SpectrumPlaybackWebSocketClient : public QObject
{
    Q_OBJECT
public:
    explicit SpectrumPlaybackWebSocketClient(QWebSocket *pSocket,QObject *parent = nullptr);
    ~SpectrumPlaybackWebSocketClient();
signals:
//    void signal_sendTextMessage(QWebSocket *pSocket,QString message);
    void signal_playback();
public slots:
    void slot_recvTextMessage(QString message);
    void slot_playbackIsRun(bool isRun);
    void slot_playbackMessage(QString message);
    void slot_playbackSpectrumData(QString data);
private:
    bool isRun;
    QWebSocket *pSocket;
    QThread *spectrumPlaybackThread;
    SpectrumPlayback *spectrumPlayback;
};

#endif // SPECTRUMPLAYBACKWEBSOCKETCLIENT_H
